import request from "@/router/axios";


// 获取列表
export const getList = (params) => {
    return request({
        url: "/api/admin/owner_coupons/pagination",
        method: "get",
        params: params,
    });
};

// 上架/下架操作
export const updateStatus = (id, data) => {
    return request({
        url: `/api/admin/owner_coupons/status/${id}`,
        method: "put",
        data: data
    });
};

// 获取详情操作
export const getDetail = (id) => {
    return request({
        url: `/api/admin/owner_coupons/sendUse/${id}`,
        method: "get",
    });
};

// 删除操作API
export const delList = (id) => {
    return request({
        url: `/api/admin/owner_coupons/delete/${id}`,
        method: "delete"
        // 移除params: { id }，因为id已经在URL中
    });
};

// 新增/编辑 操作// 修正后的 saveList 函数
export const saveList = (data) => {
  return request({
    url: "/api/admin/owner_coupons/save",
    method: "post",
    data,
  });
};

